import sys
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QIcon

class Example(QWidget):

    def __init__(this):
        super().__init__()
        this.initUI()

    def initUI(this):
        this.setGeometry(100, 100, 300, 400)
        this.setWindowTitle('Icon Test')
        this.setWindowIcon(QIcon('tst.jpg'))

        this.show()



if __name__ == '__main__':

    app = QApplication(sys.argv)
    win = Example()
    sys.exit(app.exec_())
